// #include"../DSP_chip.h"
// #include"../DSP_cluster.h"
#include"../parsing_module/instr_parsing.h"
#include<sys/types.h>
#include<unistd.h>
#include "../Global.h"
#include "../Emulator.h"

#define TEST

int hthread_dev_open(int cluster_id);

// int hthread_dev_owner(int cluster_id);

int hthread_dev_close(int cluster_id);

int hthread_dat_load(int cluster_id, char* filePath);

int hthread_dat_unload(int cluster_id);

int hthread_group_create(int cluster_id, int num);

int hthread_group_create(int cluster_id, int num, char *func_name, int scalarArgs, int ptrArgs, uint64_t *argArray);

int hthread_group_masked_create(int cluster_id, unsigned int pmask, char *func_name, int scalarArgs, int ptrArgs, uint64_t *argArray);

int hthread_group_get_status(int thread_id);

void hthread_group_wait(int thread_id);

int hthread_group_destroy(int thread_id);

int hthread_get_avail_threads(int cluster_id);

/*2.4 Device Memory Management*/

void *hthread_malloc(int cluster_id, int bytes, int mode);

void hthread_free(void *ptr);

/*2.5 Thread Synchronization*/

int hthread_barrier_create(int cluster_id);

int hthread_barrier_destroy(int barrier_id);

int hthread_rwlock_create(int cluster_id);

